static void symmetry_test (ICC *state);
-const char *babl_space_to_icc (const Babl *babl,
- const char *description,
- const char *copyright,
- BablICCFlags flags,
- int *ret_length)
+char *babl_space_to_icc (const Babl *babl,
+ const char *description,
+ const char *copyright,
+ BablICCFlags flags,
+ int *ret_length)
{
const BablSpace *space = &babl->space;
- static char icc[65536];
+ char icc[65536];
int length=65535;
ICC *state = icc_state_new (icc, length, 10);
*ret_length = length;
babl_free (state);
- return icc;
+ {
+ char *ret = malloc (length);
+ memcpy (ret, icc, length);
+ return ret;
+ }
}
long *length,
void *error);
-typedef enum {
- BABL_ICC_DEFAULTS = 0,
- BABL_ICC_COMPACT_TRC_LUT = 1,
-} BablICCFlags;
-/* babl_space_to_icc:
- *
- * Creates an ICCv2 RGB matrix profile for a babl space. The profiles strive to
- * be as small and compact as possible, TRCs are stored as 1024 entry LUT(s).
- *
- * you should make a copy of the profile before making another call to this
- * function.
- */
-
-const char *babl_space_to_icc (const Babl *space,
- const char *description,
- const char *copyright,
- BablICCFlags flags,
- int *icc_length);
/* babl_space_get_rgbtoxyz:
*/
const Babl * babl_trc (const char *name);
+typedef enum {
+ BABL_ICC_DEFAULTS = 0,
+ BABL_ICC_COMPACT_TRC_LUT = 1,
+} BablICCFlags;
+
+/* babl_space_to_icc:
+ *
+ * Creates an ICCv2 RGB matrix profile for a babl space. The profiles strive to
+ * be as small and compact as possible, TRCs are stored as 1024 entry LUT(s).
+ *
+ * the result is allocated with malloc and you should free it when done.
+ */
+
+char *babl_space_to_icc (const Babl *space,
+ const char *description,
+ const char *copyright,
+ BablICCFlags flags,
+ int *icc_length);
+
#ifdef __cplusplus
}
#endif
babl_set_user_data
babl_space
babl_space_from_xyz
+babl_space_to_icc
babl_chromaticities_make_space
babl_space_get_rgbtoxyz
babl_space_to_xyz